import math
from sympy import *

h = float(input('土层厚度(m): '))
e0 = float(input('土层初始孔隙比(kN): '))
a = float(input('压缩系数(/MPa): '))
k = float(input('渗透系数(m/s): '))


gamma_w = 10
c_v = k*(1+e0)/(a/1000*gamma_w)
c_v = c_v*60*60*24
x = Symbol('x')
t_v = solve(1-(8/3.14**2)*math.e**(0-3.14**2/4*x)-0.95, x)
t_v = float(t_v[0])
t = t_v*h**2/c_v

print('预计 %.2f 天后估计度达到95%%' %t)


dw = float(input('砂井直径(cm): '))
l = float(input('砂井间距(m): '))

t=15
dw = dw/100
t_v = c_v*t/h**2
u_z = 1 - (8/math.pi**2)*math.exp(0-math.pi**2/4*t_v)
c_h = c_v
de = 1.05*l
n = de/dw
f = n**2/(n**2-1)*math.log(n) - (3*n**2-1)/4/n**2
t_h = c_h*t/de**2
u_r = 1-math.exp(0-8*t_h/f)
u_re = 1-(1-u_r)*(1-u_z)
print('一次加荷15天时砂井地基的平均固结度为%f' %u_re)
